package cn.ac.zing.server.hj212.load;

import cn.ac.zing.server.hj212.processor.Processor;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;

/**
 * 三级解析, 入库
 * @Author：dcy
 * @name：LoadStructureProcessor
 * @Date：2024/5/19 18:21
 */
@Slf4j
public class LoadStructureProcessor extends Processor {

    public LoadStructureProcessor(JSONObject config) {
        super(config);
    }

    @Override
    public void execute(Object data) throws Exception {

        JSONObject nodedata = ((JSONObject) data);
        String code = nodedata.getString("code");
        Object o = nodedata.get("data");
        // TODO 将数据处理成自己想要的格式进行入库
        log.info("设备: {}, 入库: {}", code, o.toString());
    }
}
